﻿#region Usings

using System;
using System.Linq;
using System.Linq.Expressions;
using Rail.Net.Core.Model;

#endregion

namespace Rail.Net.Core.Interfaces.Data
{
    public interface IRepository<T> : IDisposable where T : BaseIdentifiable
    {
        IQueryable<T> All(params Expression<Func<T, object>>[] includeProperties);

        IQueryable<T> AllDefaultsIncluded();

        IQueryable<T> All(int index = 0, int size = 50, params Expression<Func<T, object>>[] includeProperties);

        IQueryable<T> Filter(Expression<Func<T, bool>> predicate);

        IQueryable<T> Filter(Expression<Func<T, bool>> predicate, int index = 0, int size = 50);

        T Find(params object[] keys);

        T Find(Expression<Func<T, bool>> predicate);
        
        T Create(T t);

        int Update(T t);

        int Delete(T t);
    }
}